package io.geekidea.boot.shop.service.base.api;

import com.baomidou.mybatisplus.extension.service.IService;
import io.geekidea.boot.framework.page.Paging;
import io.geekidea.boot.shop.dto.MemberDto;
import io.geekidea.boot.shop.entity.Member;
import io.geekidea.boot.shop.query.app.AppMemberQuery;
import io.geekidea.boot.shop.query.web.MemberQuery;
import io.geekidea.boot.shop.vo.app.AppMemberVo;
import io.geekidea.boot.shop.vo.web.MemberVo;
import io.geekidea.boot.user.entity.User;


/**
 * 用户信息 服务接口
 *
 * @author geekidea
 * @since 2024-10-27
 */
public interface MemberService extends IService<Member> {

    /**
     * 添加用户信息
     *
     * @param dto
     * @return
     * @throws Exception
     */
    boolean addMember(MemberDto dto);

    /**
     * 修改用户信息
     *
     * @param dto
     * @return
     * @throws Exception
     */
    boolean updateMember(MemberDto dto);

    /**
     * 删除用户信息
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean deleteMember(String id);

    /**
     * 用户信息详情
     *
     * @param id
     * @return
     * @throws Exception
     */
    MemberVo getMemberById(String id);

    /**
     * 用户信息分页列表
     *
     * @param query
     * @return
     * @throws Exception
     */
    Paging<MemberVo> getMemberPage(MemberQuery query);

    /**
     * App用户信息详情
     *
     * @param id
     * @return
     * @throws Exception
     */
    AppMemberVo getAppMemberById(String id);

    /**
     * App用户信息分页列表
     *
     * @param query
     * @return
     * @throws Exception
     */
    Paging<AppMemberVo> getAppMemberPage(AppMemberQuery query);

    /**
     * 根据openid获取用户信息
     * @param openid
     * @return
     */
    Member getUserByOpenid(String openid);
}
